﻿// This code is released under the BSD license.
namespace PugLib.UnitTest
{
    #region

    using System;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using TestCollateral;

    #endregion

    /// <summary>
    ///This is a test class for EventExtensionsTest and is intended
    ///to contain all EventExtensionsTest Unit Tests
    ///</summary>
    [TestClass]
    public class EventExtensionsTest
    {
        /// <summary>
        ///A test for Raise
        ///</summary>
        [TestMethod]
        public void RaiseTest()
        {
            OrderView v = new OrderView();
            v.MakeOrder();
        }

        #region Nested type: OrderView

        internal class OrderView : BaseView
        {
            public void MakeOrder()
            {
                // Do some work
                Order order = new Order { OrderId = 1, OrderName = "Computer" };

                OnCreate(this, new EventArgs<Order>(order));

                // Raise the 'Save' event
                OnSave(this, new EventArgs());
            }
        }

        #endregion
    }
}